package com.hoshiibuy.goodsAllocation.entity.param;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hoshiibuy.common.query.CommonParam;
import com.hoshiibuy.goodsAllocation.entity.GoodsSaleSubareaActivity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 查询商品销售分区活动参数
 * </p>
 * 
 * @author Mr.Wu
 * @since 2019-04-28
 */
@Data
public class GoodsSaleSubareaActivityQueryParam extends CommonParam implements Serializable {

	private static final long serialVersionUID = 1L;

	private Long id;

	@ApiModelProperty(value = "skuid")
	private Long skuid;

	@ApiModelProperty(value = "分区")
	private Long subzoneId;

	@ApiModelProperty(value = "1-298活动2-营销活动3-会员区")
	private Boolean subarea;

	@ApiModelProperty(value = "销售库存")
	private Integer saleStock;

	@ApiModelProperty(value = "销售价格")
	private BigDecimal salePrice;

	@ApiModelProperty(value = "修改时间")
	private LocalDateTime updatetime;

	@ApiModelProperty(value = "修改人")
	private String updatedby;

	public QueryWrapper<GoodsSaleSubareaActivity> getQueryWrapper() {
		QueryWrapper<GoodsSaleSubareaActivity> queryWrapper = new QueryWrapper<GoodsSaleSubareaActivity>();
		queryWrapper.eq(this.id != null, "id", this.id);
		queryWrapper.eq(this.skuid != null, "skuid", this.skuid);
		queryWrapper.eq(this.subzoneId != null, "subzone_id", this.subzoneId);
		queryWrapper.eq(this.subarea != null, "subarea", this.subarea);
		queryWrapper.eq(this.saleStock != null, "sale_stock", this.saleStock);
		queryWrapper.eq(this.salePrice != null, "sale_price", this.salePrice);
		queryWrapper.eq(StringUtils.isNotBlank(this.updatedby), "updatedby", this.updatedby);
		return queryWrapper;
	}
}
